﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using DataService;

public partial class Users_setUserPassword : System.Web.UI.Page
{
      private UserService _userService;
      public Users_setUserPassword()
    {
        _userService = new UserService();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["u"]))
        {
            lbUserChangePass.Text = Convert.ToString(Request.QueryString["u"]);
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
    }
    protected void btSave_Click(object sender, EventArgs e)
    {        
        _userService.ChangePasswordByUserName(Convert.ToString(Request.QueryString["u"]).Trim(),txtPassword.Text.Trim());
        Response.Redirect("Default.aspx");
    }
}